home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / new_file / extras / atarivew / docs / techman.doc < prev   
Text File  |  1991-05-26  |  30KB  |  834 lines

  1. 063010303010000126002006006002000
  2. 1AtariView V1.031
  3. 2Page #1
  4. F0110030001
  5. 9[.............................................................]1010
  6. ÇAtariView1.10
  7.  
  8. Atari-ST
  9.  
  10. WrittenbyTonyHoyle
  11.  
  12. *Thisisthetechnicalmanual.ForuserinformationseeATARIVIEW.DOC*
  13.  
  14. 9[...............................................................................................]2010
  15. ÇêModuleHeaders
  16. Ç
  17. Eachmoduleisastandardrelocatablefilewiththefollowinginthefirstfew
  18. bytesoftheprogram:
  19.  
  20. $0      DC.W$ABCD      VTOSModuleidentification.
  21. $2      DC.LSetup      Programinitialisationaddressor0.
  22. $6      DC.LMenu       AddressofMenuoptionassociatedwiththismodule.
  23. $A      DC.LNext       Modulechain-canbeusedtoputmorethanonemodule
  24.                         intoafile(Zeroifnomore).
  25.  
  26. TheModuleIDmustbeaconstantasGEMwillnotrelocateaprogramwhichhas
  27. arelocatablevalueinitsfirstword.
  28.  
  29. Modulesareenteredinusermode,althoughthereisnorestrictionplacedupon
  30. usingsupervisormode.
  31.  
  32. Thebasepageforeachmoduleisnotcreated,andmodulesmustnotattemptto
  33. re-allocatespacetoGEM.Spacemaybeallocatedbycreatingmemoryblocksif
  34. needed.
  35.  
  36. êMenuStructure
  37. Ç
  38. The'DrawMenu'routineiscalledwiththeaddressofalistoflongwords.
  39. EachlongwordpointstoaMenustring,asdetailedbelow.Inaddition,the
  40. firstwordofthelististhenumberofMenuoptions,andthenextLongwordis
  41. theaddressoftheTitlestring(whichisjustthestringterminatedbya
  42. null).
  43.  
  44. EachMenuentrycontains3portions-Astatusbyte,AnAddress,andthemenu
  45. string.Thisisinthefollowingformat:
  46.  
  47.         DC.Bstatus,'MenuText'
  48.         DC.Laddress
  49.  
  50. Thefirstbyteoftheaddress(always0)istakenastheEndofthestring,
  51. thereforethemenutextmustalwaysbeanoddnumberofbyteslongotherwisea
  52. buserrorwillresult.
  53.  
  54. Thestatusbyteisbitsignificant,asfollows:
  55.  
  56. Bit0   Setiftheoptionisselectable(ie.Enabled).
  57. Bit1   Setifclickingonthisopioncausesexecution,resetifitcauses
  58.         anothermenutobedisplayed.
  59.  
  60. Theaddresseitherpointstothenextmenuparametertable,ortheexecution
  61. addressoftheoption,dependingonthestatusofbit1.
  62.  
  63. êInputRoutine
  64. Ç
  65. Thisiscalledjustbeforethekeyboardisscannedduring'GetString'.Itis
  66. intendedtobeusedbythecallingroutinetomonitormouseinteraction(An
  67. exampleofitsuseisinthefileselector).
  68.  
  69. Input:  A0=Pointertonextcharacterininputstring.
  70. Ç        D1=Currentlengthofinputstring.
  71.         D2=Maximumlengthofinputstring.
  72.         D3=Lastcharactercodeentered.
  73.  
  74. Output: D0=0,Nospecialactionneeded.
  75.         1,AbandontheinputasifRightMousepressed.
  76.         2,TerminateasifReturnpressed.
  77.         3,Redisplaytheinputstringandrestartinput.
  78.  
  79. êTopLineArrayStructure
  80. Ç
  81. Thetop-lineaddresspassedtofunction28pointstoanarrayoffairlysimple
  82. data,butthismustbedefinedcorrectlyoracrashmeresult.
  83.  
  84. TheArrayisdefinedasfollows:
  85.  
  86. TopLine.40      40characterlineofASCII.
  87. Number.b        AbytedefiningthenumberofPDMsonthistopline.
  88. Unused.b        Thisbytemustbezero.
  89. Pointers.l      LongwordspointingtoeachofthePDMsinorder.
  90.  
  91. EachPDM(PullDownMenu)isdefinedasfollows:
  92.  
  93. Offset.w        Theoffsetincharactersfromtheleftedgeofthescreenof
  94.                 thisPDM.
  95. OptionEnd.w     CharacterpositionoftherightedgeofthePDMoption.
  96. Depth.w         ThedepthofthePDMinlines(alsothenumberofoptions).
  97. Width.w         ThewidthofthePDMincharacters.
  98. Options         Eachoptionstringinorder,terminatedbyanullandprefixed
  99. byabytewhichdefineswhethertheoptionisactiveornot
  100. (1=Off,2=On).
  101.  
  102. êResponseframeControlarrays
  103. Ç
  104. ThesearraysdefinetheactionoftheResponseFramehandlerupontheframe
  105. passedtoit.Youcandefineflexiblyanynumberoffieldsandmousebuttons
  106. accordingtorequirements.
  107.  
  108. TheArrayisanullterminatedlistofentrieswhichmaybeofoneoftwo
  109. types.Detailsofeachtypeareasfollows:
  110.  
  111. FieldEntry:
  112.  
  113.         DC.B'F',fieldtype
  114.         DC.WXposition          *Xpositionoffield
  115.         DC.WYposition          *Ypositionoffield
  116.         DC.WLength     *Lengthoffield
  117.         DC.LCharList   *Characterlistfortype2fields.
  118.  
  119. MouseEntry:
  120.  
  121.         DC.B'M',mousetype
  122.         DC.WXposition          *Xpositionofbutton
  123.         DC.WYposition          *Ypositionofbutton
  124.         DC.WLength             *Lengthofbuttontext
  125. Ç        DC.LRoutine    *Routineaddressfortype2buttons.
  126.  
  127. ErrorEntry:
  128.  
  129.         DC.B'E',0
  130.         DC.WXposition          *Xpositionofcontrolcode(seebelow)
  131.         DC.WYposition          *Ypositionofcontrolcode(seebelow)
  132.         DC.W0                  *Reserved-Specifyaszero
  133.         DC.L0                  *Reserved-Specifyaszero
  134.  
  135. 'fieldtype'=0meansanycharactermaybeputintothefield.
  136.         =1meansonlydigitsmaybeputintothefield
  137.         =2meansonlycharactersdefinedinthecharacterlistmaybeput
  138.                 intothefield.
  139.         +$40meansthefieldmustnotbeempty.
  140.         +$80meandthefieldmustbefull.
  141.  
  142. 'mousetype'=0meansthisisanOKButton.
  143.         =1meansthisisaCancelButton.
  144.         =2means'Routine'iscalledeverytimethisbuttonisclicked.
  145.  
  146.  
  147. êErrorEntriesÇ
  148.  
  149. Eacherrorentrypointstoonesquare,whichwillbeinitialisedto1(Red
  150. ink)or0(Blackink)beforetheframeisdisplayed,dependingontherelevent
  151. bitofd7suppliedwhen'DoResponse'iscalled.
  152.  
  153. êDefiningMemoryBlocks
  154. Ç
  155. Allmemoryblockshaveastandardformatheaderasfollows:
  156.  
  157. $00      DC.LLength     Lengthofdata+24forheader.
  158. $04     DS.B16        Nameofblock
  159. $14     DC.WType      Typeofblock(bitsignificant).
  160.  
  161. Framesareoftype$0001($0003iftheyincluderoutes).Templatesareof
  162. type$0100,andmostsystemblocksareoftype$8000(Thephoneandmailbox
  163. directoriesarestoredasblocks).
  164.  
  165. Aframeisdefinedasfollows:
  166.  
  167. $16     DC.WPages      Numberofpagesstored
  168.  
  169. $18....(Foreachpage)
  170.  
  171.         DS.B960        Theframe.
  172.  
  173.         (Alsoiftheframecontainsroutes)
  174.  
  175.         DS.B9          Pagenumber.
  176.         DS.B1          FrameID.
  177.         DS.B1          UserAccess(YorN).
  178.         DS.B5          CUGNumber.
  179.         DS.B8          Unused(ProductnumberonPrestel-notuploaded).
  180. Ç        DS.B6          Pricein10ths/p.
  181.         DS.B9*10       Choicesforkeys0..9.
  182.         DS.B1          FrameType.
  183.         DS.B1          UpdateOption.
  184.  
  185. AllentriesareinthesameformatasrequiredforPrestelBulkUpdate.
  186.  
  187. 9[..................................................................]1010
  188. ÇêVTOSsystemvariables(BasepassedinA1oninitialisation)
  189. Offset  Name            Purpose
  190.  
  191. 0000    Xposition.w     CursorXposition
  192. 0002    Yposition.w     CursorYposition
  193. 0004    ScreenBuffer.l  Baseofviewdatascreen
  194. 0008    MouseFlags.b    MouseFlagsregister(seebelow)
  195. 0009    CurFlags.b      Cursorandrevealflags(seebelow)
  196. 000A    Flags.b         Characterstateflags(seebelow)
  197. 000B    Colours.b       Background/Foregroundcolours
  198. 000C    LastGraph.b     Lastgraphiccharacterdisplayed
  199.  
  200. 000D    Speed.b         RS232Transmitspeed
  201. 000E    RSBits.b        Numberofbits(7or8)
  202. 000F    RSParity.b      Parity(0=None,1=Odd,2=Even)
  203. 0010    RSStop.b        Numberofstopbits
  204. 0011    RSFlags.b       RS232statusflags(seebelow)
  205.  
  206. 0012    MouseX.w        MouseXposition
  207. 0014    MouseY.w        MouseYposition
  208.  
  209. 0016    BaseOfFree.l    Baseofmemory
  210. 001A    TopOfFree.l     Topofmemory
  211. 001E    CurrentBase.l   Currentbaseoffreememory
  212.  
  213. 0022    MouseVector.l   Routinecalledonmousebuttonevent
  214. 0026    Button.b        Mousebuttonstatus
  215. 0027    SysFlags.b      Systemflags-notuseralterable
  216.  
  217. 0028    ScreenBase.l    Baseofdisplayedscreen
  218. 002C    CursorAddr.l    Addressofcursorcharacter
  219. 0030    CursorAddr2.l   Cursorforshadowscreen
  220. 0034    ShadowScreenP.l Baseofshadowscreen
  221.  
  222. 0038    Char.w          RS23275baudcharacter(10/11bit)
  223. 003A    Timer.w         RS23275baudtimer
  224.  
  225. 003C    GraphBuff.l     4bytegraphiccharacterbuffer
  226. 0040    CursorStore.8   8bytecursorbackgroundstore
  227. 0048    CursorStore2.8  Storeforshadowscreen
  228. 0050    Unused.8        Unused8bytebuffer
  229. 0058    DoubleList.24   24lineDoubleHeightcounter
  230. 0070    FlashList.8     8byteflashingcolourlist
  231. 0078    NextFlash.b     Nextflashcharactertobeused
  232. 0079    FlashLength.b   Currentlengthofflashlist
  233.  
  234. ≈Ç007A    ModuleCount.b   Numberofmodulesinthesystem
  235. 007B    FlashOnRate.b   Flashonperiod
  236. 007C    FlashOffRate.b  Flashoffperiod
  237. 007D    CursorRate.b    Cursorflashrate
  238. 007E    CursorCount.b   Cursorflashratecounter
  239. 007F    FlashCount.b    Flashratecounter
  240. 0080    LastInk.b       Temporaryinkcolourstore
  241. 0081    BuffLen.b       Lengthof75baudTxCharacter
  242.  
  243. 0082    CharVec.l       Backgroundmodecharacterhandler
  244. 0086    CallTimer.w     Secondsperchargeableunit(*100)
  245. 008A    UnitPrice.l     Priceperunitin100ths/p
  246. 008E    CurrentPrice.l  Priceofcurrentcallin100ths/p
  247. 0092    SecondCount.b   Vblanksuntilnextsecond
  248. 0093    ScreenFlags.b   Flagscontrollingscreenmode(seebelow)
  249. 0094    Identity.l      Pointertologinstring(clearedafteruse)
  250. 0098    InpVector.l     Addressofroutinecalledduring'GetString'
  251. 009C    KMacro.l        Addressofkeyboardmacrostring
  252.  
  253. 00A0    Year.B          BCDYearatlastenquiry
  254. 00A1    Month.B         BCDMonthatlastenquiry
  255. 00A2    Day.B           BCDDayatlastenquiry
  256. 00A3    Hour.B          BCDHouratlastenquiry
  257. 00A4    Minute.B        BCDMinuteatlastenquiry
  258. 00A5    Second.B        BCDSecondatlastenquiry(instepsof2)
  259. 00A6    Today.B         Dayofweek(0=Saturday,2=Monday,6=Friday)
  260.  
  261. ê'Flags'-Characterflagregister
  262. Ç
  263. Bit     Purpose
  264.  
  265. 0       SetwhenESC(27)hasbeensent.Resetautomatically.
  266. 1       SetwhenGraphicsmodeison.
  267. 2       SetwhenHoldGraphicsison.
  268. 3       SetwhenConcealmodeison.
  269. 4       SetwhenDoubleHeightison.
  270. 5       SetwhenFlashmodeison.
  271. 6       SetwhenSeparatedgraphicsison.
  272. 7       Temporarygraphicsflag(alwayszero).
  273.  
  274. ê'CurFlags'-Cursorflagregister
  275. Ç
  276. Bit     Purpose
  277.  
  278. 0       Setifthecursorisenabled.
  279. 1       SetwhenthescreenisRevealed.
  280. 2       Setwhenthecursorisactuallyonthescreen.
  281. 3       Interruptlockregister-setbeforewritingtothescreen.
  282. 4       Cursorflashingregister-usedbyinterrupt.
  283. 5       Characterflashingregister-usedbyinterrupt.
  284. 6       Setiftheinksneedupdating.
  285.  
  286. ≤Çê'MouseFlags'-Mouseflagregister
  287. Ç
  288. Bit     Purpose
  289.  
  290. 0       Setifthemouseisenabled.
  291. 1       Resetifthemouseisonthescreen.
  292. 2       SettodrawthemousenextVblank.
  293. 3       SetifMultiflashisenabled.
  294. 4       Ifresetincomingcharactersaredealtwithinthebackground.
  295. 5       Ifsetthisscreenmayberevealed(eg.Bufferisvalid).
  296. 6       Notused.
  297. 7       IfsetbottomlinewillberedisplayednextVblank.
  298.  
  299. ê'RSFlags'-RS232statusregister
  300. Ç
  301. Bit     Purpose
  302.  
  303. 0       DCD(Datacarrierdetect)
  304. 1       CTS(Cleartosend)
  305.  
  306. ê'ScreenFlags'-Screencontrolflags
  307. Ç
  308. Bit     Purpose
  309.  
  310. 0       Ifsetthescreenisdisplayedinblackandwhite.
  311. 1       Ifsetthescreenscrollsinsteadofwrappingtothetop.
  312. 2       Setwhenthemouseisclickedonthetopline.
  313. 3       SettoignoreanyDoubleHeightcharacters(usedforPDMs).
  314.  
  315. ÇêCallingConventions
  316. VTOSisaccessedthroughatableofaddress,thebaseofwhichispassedin
  317. registerA0whenamoduleisinitialised.RegisterA1pointstotheVTOS
  318. systemvariables.
  319.  
  320. TheGEMVDIandAEScallscannotbeusedwhenVTOSisresident.Inaddition,
  321. theGEMmouseisnotusedsomouserelatedA-Linecallswillnotwork.
  322.  
  323. êVTOSCalls
  324. Ç
  325. ü0:High-Levelcharacterdisplay(Offset0).Ç
  326.  
  327. Input:  D0.B=Charactertodisplayonthescreen.
  328.  
  329. Output: None.
  330.  
  331. AllControlcodesarefiltered,Escapecodesareexpandedandthescreen
  332. bufferisupdated.Colourcodescausethescreentoberefreshed.All
  333. registersarepreservedbythiscall.
  334.  
  335. ü1:Low-Levelcharacterdisplay(Offset4).Ç
  336.  
  337. Input:  D0.B=Charactertodisplayinthescreen.
  338.  
  339. Output: None.
  340.  
  341. Characters0..31aretreatedasescapecodes.Thecharacterisnotputinto
  342. thescreenbuffer.
  343.  
  344. ü2:RecievecharacterfromRS232(Offset8).Ç
  345.  
  346. Input:  None.
  347.  
  348. Output: D0.Wsettorecievedcharacter,or-1ifnone.
  349.  
  350. ThisroutinemustbeusedratherthantheGEMDOSroutine.
  351.  
  352. ü3:SendcharactertoRS232(Offset12).Ç
  353.  
  354. Input:  D0.B=Charactertosend.
  355.  
  356. Output: None.
  357.  
  358. UseinsteadoftheGEMDOSroutine.Thisroutinehandles1200/75baud
  359. correctly,butignoresthestateofRTSorCTS.
  360.  
  361. ±ü4:ConfigureRS232(Offset16).Ç
  362.  
  363. Input:  RSBits,RSParity,RSStop,Speedsettocorrectvalues.
  364.         Speedvaluesare:0=110baud,
  365.                        1=600baud,
  366.                         2=1200baud,
  367.                         3=2400baud,
  368.                 4=4800baud,
  369.                         5=9600baud,
  370.                 6=1200/75baud,
  371. 7=300baud.
  372.  
  373. Output: None.
  374.  
  375. UseinsteadoftheGEMDOSsetuproutine.
  376.  
  377. ü5:Storetheonlinescreenandenterbackgroundmode(Offset20).Ç
  378.  
  379. Input:  None.
  380.  
  381. Output: None.
  382.  
  383. Theonlinescreenisstoredinaspecialbufferandanynewincoming
  384. charactersfromtheRS232aredealtwithinthebackground.
  385.  
  386. ü6:Re-displaytheonlinescreenandenterforegroundmode(Offset24).Ç
  387.  
  388. Input:  None.
  389.  
  390. Output: None.
  391.  
  392. Afterthiscallitistheprogram'sresponsibilitytodealwithanyincoming
  393. characters.Thescreenisrestoredcompletelytothestateitwasinbefore
  394. itwaslaststored.
  395.  
  396. ü7:Erasecursor(Offset28).Ç
  397.  
  398. Input:  None.
  399.  
  400. Output: None.
  401.  
  402. Ensuresthatthecursorhasbeenremovedfromthescreen.Callthisroutine
  403. afterresettingthe'CursorEnable'bitinthecursorflags.
  404. Ensurethatthe'Lock'bitinthecursorflagsissetbeforecallingthis
  405. routine.
  406.  
  407. ÷ü8:DisplayCursor(Offset32).Ç
  408.  
  409. Input:  None.
  410.  
  411. Output: None.
  412.  
  413. Placesthecursoronthescreenimmediately.
  414. Ensurethatthe'Lock'bitinthecursorflagsissetbeforecallingthis
  415. routine.
  416.  
  417. ü9:Movecursor(Offset36).Ç
  418.  
  419. Input:  None.
  420.  
  421. Output: None.
  422.  
  423. Erasesthecursorfromitscurrentposition,andplacesitattheposition
  424. definedbythecursorXandYpositioninthesystemvariables.
  425. Thisroutineshouldnotnormallybeneeded,butifitisused,ensurethatthe
  426. 'Lock'bitinthecursorflagsisset.
  427.  
  428. ü10:Pointtonextcharactercell(Offset40).Ç
  429.  
  430. Input:  None.
  431.  
  432. Output: None.
  433.  
  434. Performsacursorright,wrappingifnecessarybutnotupdatingthecursor.
  435.  
  436. ü11:Storecharacterincurrentposition(Offset44).Ç
  437.  
  438. Input:  D0.B=Charactertostore.
  439.  
  440. Output: None.
  441.  
  442. Storesacharacterinthecurrentcell,andupdatestheDoubleHeightlistif
  443. necessary.
  444.  
  445. ü12:Actuponacontrolcode(Offset48).Ç
  446.  
  447. Input:  D0.B=Controlcode.
  448.  
  449. Output: None.
  450.  
  451. Thecursormayneedupdatingafterthisroutine.
  452.  
  453. ü13:Findoutwhatcolourthecurrentcharacteris(Offset52).
  454. Ç
  455. Input:  None.
  456.  
  457. Output: None.
  458.  
  459. Updatesthecoloursandflagstoberelevanttothecurrentcell.
  460. Useafteralteringthecursorposition.
  461.  
  462. ÷ü14:Enablethemouse(Offset56).Ç
  463.  
  464. Input:  D0.B=0,PlaceonthescreennextVblank,
  465.         =1,Placeonthescreenwhenitisnextmoved.
  466.  
  467. Output: None.
  468.  
  469. UseinsteadoftheA-Lineroutine.IfaDisableMousecallisencountered
  470. beforethenextVblank,themousewillnotappear.
  471.  
  472. ü15:Disablethemouse(Offset60).Ç
  473.  
  474. Input:  None.
  475.  
  476. Output: None.
  477.  
  478. UseinsteadoftheA-Lineroutine.Thisremovesthemousefromthescreen
  479. immediately,andstopsitfrombeingredrawn.
  480.  
  481. ü16:Loadandrelocateamodule(Offset64).
  482. Ç
  483. Input:  A0.L=Addressoffilename(nullterminated).
  484.         A6.L=Wheretoplacethefile.
  485.  
  486. Output: A6.L=Theendofthefile.
  487.         A5.L=TheoldvalueofA6(beginningofthefile).
  488.  
  489. UseinsteadoftheGEMrouine.Thisdoesnotcreateabasepage,andmodules
  490. maybeplacedanywhereinmemory.A6isNOTrange-checked.
  491.  
  492. ü17:Getakeyfromthekeyboard(Offset68).Ç
  493.  
  494. Input:  None.
  495.  
  496. Output: D0.W=Keypressed.IfD0.W=0thennokeywaspressed.
  497.         HighwordofD0isshift-keystatusasreturnedbyBIOS11.
  498.  
  499. ThisroutinetranslateskeyssuchasEnter,£and#toreturntheequivalent
  500. viewdatacode.
  501.  
  502. ü18:Getastringfromthekeyboard(Offset72).Ç
  503.  
  504. Input:  A0.L=Addressofbuffer.
  505.         D2.W=Maximumlengthofbuffer.
  506.  
  507. Output: Bufferfilledwithinputstring,D1.W=Lengthofstring.
  508.         D0=0,OK.D0=1,Rightmousebuttonpressed.
  509.         D3=Keywhichcausedreturn.
  510.  
  511. Thecursorwollbedisabledaftercallingthisroutine.Duringexecutionthe
  512. cursorisenabled.Thebuffershouldbeinitialisedbeforecallingtoeither
  513. nullsorspaces(theroutinewillreturnastringinthesameformatasitis
  514. sent-SpacefilledorNullterminated).Ifthebuffercontainscharacters
  515. thesewillbedisplayedandthecursorpositionedafterthelastnon-space.
  516.  
  517. ≈ü19:Allocateamemoryblock(Offset76).Ç
  518.  
  519. Input:  A0.L=Addressofstandardformatblocktoputintothesystem.
  520.  
  521. Output: IfD0.W=0thentheblockwasallocatedproperly-A1pointstoit.
  522.         IfD0.W=1thenablockwiththatnameandIDalreadyexists-A0
  523.         pointstoit.
  524.         IfD0.W=2thentherewasnotenoughmemory.
  525.  
  526. ü20:Removeamemoryblock(Offset80).Ç
  527.  
  528. Input:  A0.L=Addressofstandardformatblockheader.
  529.  
  530. Output: IfD0.W=0thentheblockwasremovedsuccessfully.
  531.         IfD0.W=1thentheblockdidnotexist.
  532.  
  533. ü21:Findamemoryblock(Offset84).Ç
  534.  
  535. Input:  A0.L=Addressofstandardformatblockheader.
  536.  
  537. Output: A0.L=Addressofblockiffound.
  538.         IfD0.W=0thentheblockwasfound.
  539.         IfD0.W=1thentheblockdidnotexist.
  540.  
  541. Usethistosearchforindefinitefiles.Tofacilitatethistheblockname
  542. maycontainthewildcards'?'and'*',andiftheblocktypeissetto$FFFF
  543. thenanyblockwiththatnamewillbefound.
  544.  
  545. ü22:Findthenextmemoryblock(Offset88).Ç
  546.  
  547. Input:  D1andA0/A1from'FindBlock'.
  548.  
  549. Output: Asfor'FindBlock'.
  550.  
  551. ü23:Refreshthecurrentscreen(Offset92).Ç
  552.  
  553. Input:  D0.B=0,don'tclearthescreenfirst.
  554.         <>0,clearthescreenfirst.
  555.         A0.L=Addressofbuffer.
  556.  
  557. Output: None.
  558.  
  559. Usethistorefreshthescreenafterithasbecomecorrupted(perhapsbythe
  560. fileselector).
  561.  
  562. ü24:Clearthestatuslineandpointtoit(Offset96).Ç
  563.  
  564. Input:  None.
  565.  
  566. Output: None.
  567.  
  568. Thisfunctionisintendedforusebyprogramswhichdisplayerrorsorrequest
  569. input.Itdoesnotstorethecoloursandshouldbeusedwithcare.
  570.  
  571. εü25:Displayfileselectorandfetchafilename(Offset100).Ç
  572.  
  573. Input:  A0.L=Addressoffilenamebuffer.
  574.         A1.L=Addressofheadingstring.
  575.         A2.L=Filetosearchfor(blockifsearchingRAM).
  576.         A3.L=Defaultpath(Diskonly).
  577.         D0.W=Lengthoffilename.
  578.         D1.B=0,RAMor1,Disk.
  579.  
  580. Output: A0.L=Filenamepaddedwithspaces.
  581.         A1.L=Fullpathnameoffile(zeroterminated).
  582.         D0.W=0,OK.
  583.         <>0,Error.
  584.  
  585. ThisfunctionshouldbeusedinsteadoftheGEMfileselector.Itis
  586. recommendedthatthefullpathnamereturnedisusedfordiskfiles(thisis
  587. notinitialisedforRAMfiles).
  588.  
  589. ü26:Dialanumber(Offser104).Ç
  590.  
  591. Input:  A0.L=Telephonenumber(zeroterminated).
  592.         A1.L=Dialcommandstring.
  593.         D0.B=Dialtype:0-None.
  594.                         1-RTSandDTR.
  595.                         2-Smart,usingdialcommand.
  596.  
  597. Output: None.
  598.  
  599. ThisfunctioncausestheModemtopickupthelineanddial.IfD0=0thenthe
  600. routinejustreturns.ThenumberisanASCIIstring,whichmaycontaincommas
  601. andspaces.'^'isusedtodenotecontrolcodesinthedialcommand-'^M'is
  602. Return.
  603.  
  604. ü27:Usepredefinedcolourmacro(Offset108).Ç
  605.  
  606. Input:  D0.W=Functionkeynumber(1..10).
  607.         D1.W=Shiftkeystatus-bit0=Shift.
  608.                                       1=Ctrl.
  609.                                       2=Alt.
  610.  
  611. Output: None.
  612.  
  613. Thisfunctionisusedtoimplementthepredefinedcolourmacros.Theshift
  614. keyandfunctionkeyvaluesmaybederivedfromthevaluesreturnedfrom
  615. Function17(GetKey).
  616.  
  617. ⌠ü28:Monitorinteractionwiththetopline(Offset116).Ç
  618.  
  619. Input:  A0.L=ToplineArrayaddress.
  620.  
  621. Output: D0.W=PDMnumberselected(0..n).
  622.         D1.W=OptionnumberwithinPDM(0..n).
  623.  
  624. Usethisfunctiontoimplementpull-downmenus.Ifduringtheexecutionofa
  625. programitfindsbit2ofScreenFlagsissetthisroutineshouldbecalled,
  626. andthebitreset.IfD0.Wisnegativethennothingwasselected,andD1is
  627. meaningless.
  628.  
  629. ü29:RaiseDTRandRTS(Offset120).Ç
  630.  
  631. Input:  None.
  632.  
  633. Output: None.
  634.  
  635. ThisisusedtotellaModemthatyouareabouttogoonline,andwithsome
  636. Modemsitwillactuallypickuptheline.Usebeforedialling.
  637.  
  638. ü30:DropDTRandRTSifnoDCDÇü(Offset124).Ç
  639.  
  640. Input:  None.
  641.  
  642. Output: None.
  643.  
  644. Usethisroutineonexitfromaterminalemulator.Ifthereisnocarrierthe
  645. linewillbedropped.
  646.  
  647. #ü31:EnterResponseFramehandler(Offset128).Ç
  648.  
  649. Input:  A0.L=AddressofblankResponseFrame.
  650.         A1.L=AddressofControlArray.
  651.         A2.L=Addressofauto-execroutineor0.
  652.         A3.L=Defaultfields.
  653. D7.B=Bitsignificanterrorhandlerflags
  654.  
  655. Output: D0.W=0,OK.
  656.         <>0,Cancel.
  657.         D3.W=Mousebuttonthatcausedexit(1..n).
  658.  
  659. Ifa'Cancel'buttonispressedtoexittheDefaultFieldsarepreserved,
  660. otherwisetheyarechangedtoreflectwhattheuserentered.ThevalueinD3
  661. maybeusedtoimplementspecialroutinessuchas'NextFrame'buttons.
  662.  
  663. Theerrorhandlerflagsaretestedwhenan'E'fieldisfound.Thefirst'E'
  664. fieldisbit0,thesecondisbit1,etc.Youmayonlyhave8'E'fieldsin
  665. anyoneframe.
  666.  
  667. ∩ü32:FieldConversion(Offset132).Ç
  668.  
  669. Input:  D1.W=Lengthoffield.
  670.         D0.B=Conversiontype:
  671.  
  672.         0:ConvertASCIInumberin(A0)to(A1)addingleadingzeros.
  673.         1:ConvertASCIInumberin(A0)to(A1)removingleadingzeros.
  674.         2:ConvertASCIInumberin(A0)toD0.L.
  675.         3:Copy(A0)to(A1)removingtrailingnull.
  676.         4:Copy(A0)to(A1)addingnullatendofstring.
  677.         5:ConvertLongwordat(A0)toASCIIat(A1).
  678.  
  679. Output: Seeabove.
  680.  
  681. Thisisusefulforconvertingoutputfromresponseframes(whichisalways
  682. spacefilledASCII)tointernalrepresentationsofthedata.
  683.  
  684. ü33:RefreshTime&Datevalues(Offset136).Ç
  685.  
  686. Input:  None.
  687.  
  688. Output: None.
  689.  
  690. CallthisroutinebeforereadingBCDTime&Datefromsystemvariables.
  691.  
  692. Ç**************************************************************************
  693. *                                SYSRESET.S                              *
  694. *                                                                        *
  695. *  Written using Hisoft Devpac-2                                         *
  696. *                                                                        *
  697. *  Example VDT file, which adds the option to reset the system           *
  698. *  This program is rather verbose in places...!                          *
  699. *                                                                        *
  700. *  Version 1.00 11th September 1989                                      *
  701. *  Added new VTOS calls - Version 1.01 27th May 1990                     *
  702. *                                                                        *
  703. **************************************************************************
  704.  
  705.                opt o+                     *  Optimisation on
  706.                output .VDT                *  Override default .PRG
  707.         
  708.                section text
  709.  
  710. * The CallVTOS macro is quite handy.  Feel free to use it in your own
  711. * programs.
  712.  
  713. CallVTOS:       macro
  714.                 clr.l -(sp)             *  Dummy argument
  715.                 move.l a0,-(sp)         *  Store register
  716.                 move.l VtosBase,a0      *  Base of table
  717.                 move.l \1*4(a0),4(sp)   *  Store jump
  718.                 move.l (sp)+,a0         *  Retrieve register
  719.                 rts                     *  Indirect jump to routine
  720.                 endm
  721.  
  722. *  This is where the program code starts.  First we must define the 
  723. *  VTOS header.
  724.  
  725.                 dc.w $abcd              *  This is a VTOS module
  726.                 dc.l Setup              *  Initialisation
  727.                 dc.l ResetMenu          *  Menu option
  728.                 dc.l 0                  *  No chain
  729.  
  730. *  Note the above value may be altered.  To put more than one module in
  731. *  a single file use the 'chain' value to define where the next header
  732. *  is.
  733.  
  734. *  Initialisation - Must not alter registers a0-a5 or d0-d7
  735.  
  736. Setup:          movem.l a0-a5/d0-d7,-(sp)
  737.                 move.l a0,VtosBase      *  VTOS base address
  738.                 move.l a1,VtosBss       *  VTOS BSS address
  739.                 move.l a1,a6            *  Set base pointer
  740.  
  741. *  Put your initialisation here!
  742. *  A6 is not altered by any VTOS routines, and by convention points to the
  743. *  VTOS BSS address.  Alter this at your peril!
  744.  
  745.                movem.l (sp)+,a0-a5/d0-d7
  746.                rts
  747. Ç        
  748. Reset:         move.b $26(a6),d0       *  Fetch mouse button status
  749.                and.b #$fc,d0           *  Wait for mouse to be stopped
  750.                bne Reset               *  Wait for it...!
  751.  
  752. *  The next bit is a pretty standard system-reset routine
  753. *  The purpose of waiting for both mouse buttons to be lifted is because
  754. *  the IKBD controller gets confused if you hold down a mouse button during
  755. *  a system reset.
  756.  
  757.                clr.l -(sp)             *  SSP=USP
  758.                move.w #$20,-(sp)       *  Supervisor/User mode toggle
  759.                trap #1
  760.                move.l $4f2,a0          *  System reset PC address
  761.                move.l (a0),-(sp)       *  Fetch reset value
  762.                rts                     *  Jump into it!
  763.  
  764. *  Although not used by this program, VTOS calls are defined as follows.
  765. *  See VTOS technical manual for further details on each routine
  766.  
  767. PrintCharacter: CallVTOS 0
  768. DisplayChar:    CallVTOS 1
  769. RxCharacter:    CallVTOS 2
  770. TxCharacter:    CallVTOS 3
  771. ConfigRS232:    CallVTOS 4
  772. GotoBackground: CallVTOS 5
  773. GotoOnline:     CallVTOS 6
  774. EraseCursor:    CallVTOS 7
  775. DisplayCursor:  CallVTOS 8
  776. MoveCursor:     CallVTOS 9
  777. StepToNext:     CallVTOS 10
  778. StoreCharacter: CallVTOS 11
  779. ControlAction:  CallVTOS 12
  780. GetColour:      CallVTOS 13
  781. MouseOn:        CallVTOS 14
  782. MouseOff:       CallVTOS 15
  783. LoadRelocate:   CallVTOS 16
  784. GetKey:         CallVTOS 17
  785. GetString:      CallVTOS 18
  786. AllocateBlock:  CallVTOS 19
  787. RemoveBlock:    CallVTOS 20
  788. FindBlock:      CallVTOS 21
  789. FindNext:       CallVTOS 22
  790. RfshScreen:     CallVTOS 23
  791. ClearBottom:    CallVTOS 24
  792. FileSelector:   CallVTOS 25
  793. DialComputer:   CallVTOS 26
  794. UseColour:      CallVTOS 27
  795. UseTopLine:     CallVTOS 28
  796. RaiseDTR:       CallVTOS 29
  797. DropDTR:        CallVTOS 30
  798. DoResponse:     CallVTOS 31
  799. ConvertField:   CallVTOS 32
  800. FetchTime:      CallVTOS 33
  801. RapidDisplay:   CallVTOS 34
  802. ÇReadCookie:     CallVTOS 35
  803. WriteCookie:    CallVTOS 36
  804.  
  805.                section data
  806.  
  807. *  The menus are defined here
  808.  
  809. ResetMenu:     dc.b 1,'Reset System '  *  Enabled, goes to menu
  810.                dc.l ResetSubMenu       *  Address of menu
  811.  
  812. ResetSubMenu:  dc.w 1                  *  Just one option
  813.                dc.l ResetSubTitle      *  Title string
  814.                dc.l ResetSubOpt1       *  Option 1
  815.         
  816. ResetSubTitle: dc.b 'Reset system',0   *  Title string
  817.  
  818.                even
  819.  
  820. *  Note the line below is the same format as 'ResetMenu'
  821. *  Remember each option string must be of an odd length.
  822.  
  823. ResetSubOpt1:  dc.b 3,'Yes Please '    *  Enabled, executes
  824.                dc.l Reset              *  Routine address
  825.  
  826.                section bss
  827.         
  828. VtosBase:      ds.l 1                  *  VTOS jump-table address
  829. VtosBss:       ds.l 1                  *  VTOS system variables
  830.  
  831. Ç
  832.